#include "mystdio.h"
#include <string.h>
#include <unistd.h>
#include "mystring.h"

int main()
{
    MyFile *filep = MyFopen("./log.txt", "a");
    if(NULL == filep)
    {
        printf("fopen erroe!\n");
        return 1;
    }
  
    int cnt = 10;
    while(cnt--)
    {
        char *msg = (char*)"hello myfile!!!!";
        MyFwrite(filep, msg, strlen(msg));
        MyFFlush(filep);

        printf("buffer: %s\n", filep->outbuffer);
        sleep(1);
    }

    MyClose(filep); 

    const char *str = "hello mystring";
    printf("len: %d\n", my_strlen(str));


    return 0;
}
